<h2><?php echo Yii::t('app','Register'); ?></h2>

<?php if(Yii::app()->user->hasFlash('register')): ?>

<div class="flash-success">
    <?php echo Yii::app()->user->getFlash('register'); ?>
</div>

<?php else: ?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'register-form',
    'enableClientValidation'=>true,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
    ),
)); ?>

    <div class="block">
    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'login'); ?>
        <?php echo $form->textField($model,'login'); ?>
        <?php echo $form->error($model,'login'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'password'); ?>
        <?php echo $form->passwordField($model,'password',array('size'=>'25')); ?>
        <?php echo $form->error($model,'password'); ?>
        <div class="note">
            <?php echo Yii::t('account','Must be at least 4 characters long.'); ?>
        </div>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model,'password_repeat'); ?>
        <?php echo $form->passwordField($model,'password_repeat',array('size'=>'25')); ?>
        <?php echo $form->error($model,'password_repeat'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'firstname'); ?>
        <?php echo $form->textField($model,'firstname'); ?>
        <?php echo $form->error($model,'firstname'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'lastname'); ?>
        <?php echo $form->textField($model,'lastname'); ?>
        <?php echo $form->error($model,'lastname'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'email'); ?>
        <?php echo $form->textField($model,'email'); ?>
        <?php echo $form->error($model,'email'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'language'); ?>
        <?php echo $form->dropDownList($model,'language',$model->getlanguageList()); ?>
        <?php echo $form->error($model,'language'); ?>
    </div>

    <?php if(Yii::app()->params['openIdEnabled']): ?>
    <div class="row">
        <?php echo $form->labelEx($model,'identity_url'); ?>
        <?php echo $form->textField($model,'identity_url'); ?>
        <?php echo $form->error($model,'identity_url'); ?>
    </div>
    <?php endif; ?>

    <?php if(CCaptcha::checkRequirements()): ?>
    <div class="row">
        <?php echo $form->labelEx($model,'verifyCode'); ?>
        <div>
        <?php $this->widget('CCaptcha'); ?>
        <?php echo $form->textField($model,'verifyCode'); ?>
        </div>
        <div class="hint">Please enter the letters as they are shown in the image above.
        <br/>Letters are not case-sensitive.</div>
        <?php echo $form->error($model,'verifyCode'); ?>
    </div>
    <?php endif; ?>
    </div>
        
    <?php echo CHtml::submitButton(Yii::t('app','Submit')); ?>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php endif; ?>